package com.yxq.mdt.app.modules.message.ui;

import android.view.View;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;

import com.hyphenate.easeui.ui.EaseConversationListFragment;
import com.yxq.mdt.app.BuildConfig;
import com.yxq.mdt.app.R;
import com.yxq.mdt.app.base.BaseFragment;
import com.yxq.mdt.app.base.ibase.IBaseContract;
import com.yxq.mdt.app.modules.chat.fragment.ConversationListFragment;

import butterknife.BindView;

/**
 * @author L
 * @time 2019-11-14
 * @describe 消息页面-打招呼
 */
public class MessageGreetFragment extends BaseFragment {
    @BindView(R.id.container)
    FrameLayout container;

    @Override
    protected int attachLayoutId() {
        setImmersionBarEnabled(false);
        return R.layout.fragment_massage_greet;
    }

    @Override
    protected IBaseContract.IBasePresenter getPresenter() {
        return null;
    }

    @Override
    public void initView(View view) {
        if (BuildConfig.DEBUG) {
            view.findViewById(R.id.empty_view).setVisibility(View.GONE);
            view.findViewById(R.id.container).setVisibility(View.VISIBLE);

            ConversationListFragment easeConversationListFragment = new ConversationListFragment();
            FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
            if (!easeConversationListFragment.isAdded()) {
                transaction.add(R.id.container, easeConversationListFragment);
            }
            transaction.commitAllowingStateLoss();
        } else {
            view.findViewById(R.id.empty_view).setVisibility(View.VISIBLE);
            view.findViewById(R.id.container).setVisibility(View.GONE);
        }

    }

    @Override
    public void initData() {

    }

    @Override
    public void setData(@Nullable Object data) {

    }
}
